package javaee.send;

import javaee.send.Ibook.IBook;
import org.springframework.cglib.proxy.InvocationHandler;

import java.lang.reflect.Method;

public class MyInvocationHandlerBook implements InvocationHandler {
    private IBook book;
    public MyInvocationHandlerBook(IBook book) {
        this.book = book;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("do something before");
        Object invoke = method.invoke(book, args);
        System.out.println("do something after");
        return invoke;
    }

}
